﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<Blog.Core.Theme>>" %>

<% if (Request.IsAuthenticated && Context != null && Context.User != null && Context.User.IsInRole("Administrator"))
{ %>
<div>
    <%: Html.ActionLink("Добавить", "Edit", new RouteValueDictionary( new { id = 0 } ), new Dictionary<string, object>() { { "class", "more" }}) %>
    <br />
    <br />
</div>

<% } foreach (var item in Model) { %>
<table class="table_news_context">
    <tr>
        <th>
            <%= item.ThemeHeader %> 
            <% if (Request.IsAuthenticated && Context != null && Context.User != null && Context.User.IsInRole("Administrator"))
               { %>
            (<%: Html.ActionLink("Изменить", "Edit", new { id = item.ID })%>) (<%: Html.ActionLink("Удалить", "Delete", new { id = item.ID })%>)
             <% } %>
        </th>
    </tr>    
    <tr>
        <td>     
            <%= item.Description %>
            <br />
            <br />
            <%= Blog.Helpers.LabelHelper.GetHuperlink("Коментарии", "CommentsTree", "Comments", item.ID, "more")%>
            <br />
        </td>
    </tr>    
</table>
<% } %>